public with sharing class SearchAccountController {

    public PageReference search() {
        if(String.isblank(searchstring)){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, '検索文字は1文字以上入力してください！'));
            return null;
        }
        aList = [select name, billingcity, billingcountry from account where name like :('%' + searchString + '%')];
        num = aList.size();
        return null;
    }

    public List<Account> aList { get; set; }
    public Integer num { get; set; }
    public String searchString { get; set; }
}